program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  pelement = ^element;
element = record
  value : Integer;
  next : pelement;
end;

var
  head : pelement;

begin
  New(head);
  head^.value := 5;
  New(head.next);
  head^.next.value := 8;
  new(head^.next^.next);
  head^.next^.next^.value := 8;
  head^.next^.next^.next := nil;
  while(head <> nil) do Begin
      write(head.value);
      head  := head.next;
  end;
  Readln;
end.
